package com.example.facility.common;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 业务逻辑异常 Exception
 * @author admin
 */
@Data
@EqualsAndHashCode(callSuper = true)
public final class ServiceException extends ErrorCodeException {

    /**
     * 空构造方法，避免反序列化问题
     */
    public ServiceException() {
    }

    public ServiceException(ErrorCode errorCode) {
        super(errorCode);
    }

    public ServiceException(Integer code, String message) {
        super(code, message);
    }

    @Override
    public ServiceException setCode(Integer code) {
        super.setCode(code);
        return this;
    }

    @Override
    public ServiceException setMessage(String message) {
        super.setMessage(message);
        return this;
    }

}
